package com.springboot.base.dal;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.base.model.Shop;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author meiguangya
 * @since 2020-07-17
 */
public interface ShopMapper extends BaseMapper<Shop> {

    IPage<Shop> selectByPage(Page page);

    List<Shop> recommend(@Param("longitude")BigDecimal longitude, @Param("latitude")BigDecimal latitude);

    List<Shop> search(@Param("longitude")BigDecimal longitude, @Param("latitude")BigDecimal latitude,
                      @Param("keyword")String keyword, @Param("orderby")Integer orderby,
                      @Param("categoryId")Integer categoryId, @Param("tags")String tags);

    List<Map<String,Object>> searchGroupByTags(@Param("keyword")String keyword, @Param("categoryId")Integer categoryId, @Param("tags")String tags);
}
